package com.lovo.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lovo.sys.bean.UserOrderBean;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.domain.Page;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface IUserOrderMapper extends BaseMapper<UserOrderBean> {
    public IPage<UserOrderBean> findAll(Page pg);
    /**
     * 通过下单时间和商品类型查询出订单集合，
     * @param Date
     * @param type
     * @return
     */
    public IPage<UserOrderBean> findByDateAndType(LocalDate Date, String type, Page pg);

    /**
     * 根据订单id查询出订单对象
     * @param idNum 订单id
     * @return 订单对象
     */

    public UserOrderBean findByUserOrderId(String  idNum);

    /**
     * 根据订单id修改是否删除状态
     * @param UserOrderId
     */
    public void deleteByUserOrderId(long UserOrderId);

    /**
     * 添加订单
     * @param userOrderBean 订单对象
     */
    public void addUserOrder(UserOrderBean userOrderBean);
    /**
     * 根据传入的不同状态码,修改订单状态
     * @param num 状态码
     */
    public void updateUserOrder(Integer num);

    public List<String> findAllType();
}
